﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE HTML>
<!-- saved from url=(0030)http://localhost:8080/House-2/ -->
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>青鸟租房 - 首页</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<LINK rel=stylesheet type=text/css href="css/style.css">
<META name=GENERATOR content="MSHTML 8.00.7601.17514"></HEAD>
<BODY>

<script src="scripts/jquery-1.8.3.js"></script>
  <script type="text/javascript">
  
  
  $(function(){
	  
	  
	  //用ajax查找二级联动的街道信息
		 $("SELECT[name='district_id']").change(function(){
				  
				  var countyno = $("SELECT[name='district_id']").val();//拿到父级区的值
				  
				  $("select[name='street_id']").empty();//清除子节点
		
				  $.post('findStreet',{countyno:$("select[name='district_id']").val()},function(mess){

						$.each(mess,function(index,data){
							 $("SELECT[name='street_id']").append("<option value='"+data.streetno+"'>"+data.sName+"</option>");
						})
					})
				  
				  
			  })
	  
	  
  })
  
  
 
  
  
  
  
  
	function firstpage(){
		$("#sform").attr("action","first");
		var form=$("#sform");
		form.submit();
	};
	function lastpage(){
		$("#sform").attr("action","last");
		var form=$("#sform");
		form.submit();
	};
	function prevpage(index){
		$("#sform").attr("action","prev?index="+index);
		var form=$("#sform");
		form.submit();
	};
	function nextpage(index){
		$("#sform").attr("action","next?index="+index);
		var form=$("#sform");
		form.submit();
	};
	
	
	
  </script>
  

<DIV id=header class=wrap>
<DIV id=logo><IMG src="images/logo.gif"></DIV></DIV>
<DIV id=navbar class=wrap>
<DL class="search clearfix">
  <FORM id=sform method=post action="findHouse">
  <DT>
  <UL>
    <LI class=bold>房屋信息</LI>
   <LI>标题：<INPUT class=text type=text name=title <c:if test="${hTitle ne null}">value="${hTitle}"</c:if> > <LABEL class=ui-blue><INPUT onclick=doSearch() value=搜索房屋 type=submit name=search></LABEL> 
    </LI></UL></DT>
  
  
  
  <DD>
  <UL>
    <LI class=first>区县</LI>
	    <LI>
	    <SELECT id="county" name=district_id>
	    				<c:if test="${h_countyno eq null}">
					    <OPTION selected value="">不限</OPTION>
					    </c:if>
					    <c:if test="${h_countyno ne null}">
					    <OPTION  value="">不限</OPTION>
					    </c:if>
					    <c:forEach items="${clist}" var="clist" varStatus="cindex">
					    	<c:if test="${h_countyno eq clist.countyno}">
					    	<OPTION selected value=${clist.countyno}>${clist.cName}</OPTION> 
					    	</c:if>
					    	<c:if test="${h_countyno ne clist.countyno}">
					    	<OPTION value=${clist.countyno}>${clist.cName}</OPTION> 
					    	</c:if>
					    </c:forEach>
		</SELECT> 
		</LI>
	</UL>
 </DD>





  <DD>
  <UL>
    <LI class=first>街道</LI>
    <LI>
    <SELECT id=street name=street_id>
	     <c:if test="${h_streetno eq null}">
		    <OPTION selected value="">不限</OPTION>
		    </c:if>
		    <c:if test="${h_streetno ne null}">
		    <OPTION value="">不限</OPTION>
		    </c:if>
		     <c:forEach items="${slist}" var="slist" varStatus="sindex">
				<c:if test="${h_streetno eq slist.streetno}">
				<OPTION selected value=${slist.streetno}>${slist.sName}</OPTION> 
				</c:if>
				<c:if test="${h_streetno ne slist.streetno}">
				<OPTION value=${slist.streetno}>${slist.sName}</OPTION> 
				</c:if>
			</c:forEach>
     </SELECT> 
</LI>
</UL>
</DD>
      
           
      
  <DD>
  <UL>
    <LI class=first>房型</LI>
    <LI>
    <SELECT name=type_id> 
	    <c:if test="${h_typeno eq null}">
					    <OPTION selected value="">不限</OPTION>
					    </c:if>
					    <c:if test="${h_typeno ne null}">
					    <OPTION value="">不限</OPTION>
					    </c:if>
					    <c:forEach items="${tlist}" var="tlist" varStatus="tindex">
						<c:if test="${h_typeno eq tlist.typeno}">
						<OPTION selected value=${tlist.typeno}>${tlist.typeArea}</OPTION> 
						</c:if>
						<c:if test="${h_typeno ne tlist.typeno}">
						<OPTION value=${tlist.typeno}>${tlist.typeArea}</OPTION> 
						</c:if>
						</c:forEach>
     </SELECT> 
  </LI>
  </UL>
  </DD>
  
  
  <DD>
  <UL>
    <LI class=first>价格 </LI>
    <LI>
    	<SELECT name=price> 
				<c:if test="${hPrice eq null}">
						<OPTION value="0">不限</OPTION>
					    <OPTION value="0-1000">0-1000</OPTION> 
					    <OPTION value=1000-2000>1000-2000</OPTION> 
					     <OPTION value=2000-4000>2000-4000</OPTION>
				</c:if> 
				<c:if test="${hPrice ne null}">
					 	<<OPTION selected value=${hPrice}>${hPrice}</OPTION>
					    <OPTION value="0-1000">0-1000</OPTION> 
					    <OPTION value=1000-2000>1000-2000</OPTION> 
					     <OPTION value=2000-4000>2000-4000</OPTION>
				</c:if>
		</SELECT> 
	</LI>
	</UL>
</DD>



  <DD>
  <UL>
    <LI class=first>面积 </LI>
    <LI>
    <SELECT name=floorage> 
    				<c:if test="${hArea eq null}">
    				<OPTION value="0">不限</OPTION>
				    <OPTION value="0-60">0-60</OPTION>
				    <OPTION value=60-100>60-100</OPTION>
				    <OPTION value=100-200>100-200</OPTION>
				    </c:if>
				    <c:if test="${hArea ne null}">
				     <OPTION selected value=${hArea}>${hArea}</OPTION>
				    <OPTION value="0-60">0-60</OPTION>
				    <OPTION value=60-100>60-100</OPTION>
				    <OPTION value=100-200>100-200</OPTION>
				    </c:if>
     </SELECT> 
     </LI>
     </UL>
     </DD>


</FORM>
</DL>
</DIV>





<DIV class="main wrap">
<TABLE class=house-list>
  <TBODY>
  
  
  <c:forEach items="${hlist}"  var="h"  varStatus="index">
	  <TR>
	    <TD class=house-thumb><span><A href="HouseServlet?info=selectHouseNow&houseno=${h.houseno}" target="_blank"><img src="images/${h.hPictrue}" width="100" height="75" alt=""></a></span></TD>
	    <TD>
	      <DL>
	        <DT><A href="HouseServlet?info=selectHouseNow&houseno=${h.houseno}"  target="_blank">${h.hTitle}</A></DT>
	        <DD>${h.county.cName}${h.street.sName},${h.hArea}平米<BR>联系方式：${h.hTel}</DD></DL></TD>
	    <TD class=house-type>${h.type.typeArea}</TD>
	    <TD class=house-price><SPAN>${h.hPrice}</SPAN>元/月</TD>
	    </TR>
    </c:forEach>
    
    
  <TR><c:if test="${hlist eq null}">无租房信息</c:if></TR></TBODY></TABLE>
  
  
<DIV class=pager>
<UL>
  <LI class=current><A href="javascript:void(0)" onclick="javascript:firstpage()">首页</A></LI>
  <c:if test="${page.pageNum ne 1 }">
  	<LI><A href="javascript:void(0)" onclick="javascript:prevpage(${page.pageNum})">上一页</A></LI>
  </c:if>
  <c:if test="${page.pageNum ne page.pages }">
  	 <LI><A href="javascript:void(0)" onclick="javascript:nextpage(${page.pageNum})" >下一页</A></LI>
  </c:if>
  <LI><A href="javascript:void(0)" onclick="javascript:lastpage()">末页</A></LI></UL><SPAN 
class=total>${page.pageNum}/${page.pages}页</SPAN> </DIV></DIV>
<DIV id=footer class=wrap>
<DL>
  <DT>青鸟租房 © 2010 北大青鸟 京ICP证1000001号</DT>
  <DD>关于我们 · 联系方式 · 意见反馈 · 帮助中心</DD></DL></DIV></BODY></HTML>
